﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VisitorPattern.BLL.Interface;
using VisitorPattern.Model;

namespace VisitorPattern.BLL
{

    // "ObjectStructure"
    class EmployeesManager
    {
        // Fields
        private ArrayList employees = new ArrayList();

        // Methods
        public void Attach(Employee employee)
        {
            employees.Add(employee);
        }

        public void Detach(Employee employee)
        {
            employees.Remove(employee);
        }

        public void Accept(IVisitor<Employee> visitor)
        {
            foreach (Employee e in employees)
            {
                visitor.Visit(e);
            }
        }
    }
}
